#ifndef _MUNIX_OPCODES_H_
#define _MUNIX_OPCODES_H_

#include <iostream> 
using namespace std;

#include "common.h"

void increment(byte &);
void decrement(byte &);
void readchar(FILE *, char &, status &);
int  hexdigit(char);
int  getnumber(FILE *, int, status &);

enum class OpCode
{
    // Arithmetic and Logic
    ADD, ADC, ADIW, SUB, SUBI, SBC, SBCI, AND, ANDI, OR, ORI, EOR,
    COM, NEG, SBR, CBR, INC, DEC, TST, CLR, SER, MUL, MULS, MULSU,

    // Branching
    RJMP, IJMP, EIJMP, JMP, RCALL, ICALL, EICALL, CALL, RET, RETI,
    CP, CPI, SBRC, SBRS, SBIC, SBIS, BRBS, BRBC, BREQ, BRNE, BRCS,
    BRCC, BRSH, BRLO, BRMI, BRPL, BRGE, BRLT, BRHS, BRHC, BRTS,
    BRTC, BRVS, BRVC, BRIE, BRID,

    // Data Transfer
    MOV, MOVW, LDI, LDS, LD, LDD, STS, ST, STD, LPM, ELPM, SPM,
    IN, OUT, PUSH, POP,

    // Bit and bit-tests
    LSL, LSR, ROL, ROR, ASR, SWAP, BSET, BCLR, SBI, CBI, BST, BLD,
    SEC, CLC, SEN, CLN, SEZ, CLZ, SEI, CLI, SES, CLS, SEV, CLV,
    SET, CLT, SEH, CLH,

    // MCU Control
    BREAK, NOP, SLEEP, WDR,

    // Non-AVR unique support
    EQL, NEQ, GRT, LST, LEQ, GEQ, DUMP, PRN, PRS, CLRF, DSP, ADR,
    STO, BRUN,FMUL, VAL, IND, HALT, INN, CRLF,


    BAD=0xFF
};

enum class Directive
{
    BYTE, CODE, DB, DEF, DEVICE, DATA, DW, EQU, EEPROM, EXIT,
    INCLUDE, LIST, NOLIST, ORG, SET, ASCII, STRING,

    IF, ELSE, ELSIF, ENDIF, ERROR, GLOBAL, PRINT,

    BAD=0xFF
};




#endif	/* _MUNIX_OPCODES_H_ */
